/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.zx.common.material.entity;

import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.entity.TreeEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 公共资料Entity
 * @author zpp
 * @version 2020-02-14
 */
@Table(name="t_common_material", alias="a", columns={
		@Column(name="id", attrName="id", label="主键", isPK=true),
		@Column(name="obj_name", attrName="objName", label="数据名称", queryType=QueryType.LIKE, isTreeName=true),
		@Column(name="obj_picture", attrName="objPicture", label="图片"),
		@Column(name="obj_type", attrName="objType", label="数据类型"),
		@Column(includeEntity=TreeEntity.class),
		@Column(includeEntity=DataEntity.class),
		@Column(name="obj_explain", attrName="objExplain", label="数据说明"),
		@Column(name="obj_answer", attrName="objAnswer", label="答案"),
		@Column(name="content", attrName="content", label="内容"),
		
	}, orderBy="a.tree_sorts, a.id"
)
public class TcommonMaterial extends TreeEntity<TcommonMaterial> {
	
	private static final long serialVersionUID = 1L;
	private String objName;		// 数据名称
	private String objPicture;		// 图片
	private Integer objType;		// 数据类型
	private Integer objExplain;		// 数据说明
	private String objAnswer;		// 答案
	private String content;
	
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public TcommonMaterial() {
		this(null);
	}

	public TcommonMaterial(String id){
		super(id);
	}
	
	@Override
	public TcommonMaterial getParent() {
		return parent;
	}

	@Override
	public void setParent(TcommonMaterial parent) {
		this.parent = parent;
	}
	
	@Length(min=0, max=255, message="数据名称长度不能超过 255 个字符")
	public String getObjName() {
		return objName;
	}

	public void setObjName(String objName) {
		this.objName = objName;
	}
	
	@Length(min=0, max=500, message="图片长度不能超过 500 个字符")
	public String getObjPicture() {
		return objPicture;
	}

	public void setObjPicture(String objPicture) {
		this.objPicture = objPicture;
	}
	
	public Integer getObjType() {
		return objType;
	}

	public void setObjType(Integer objType) {
		this.objType = objType;
	}
	
	public Integer getObjExplain() {
		return objExplain;
	}

	public void setObjExplain(Integer objExplain) {
		this.objExplain = objExplain;
	}
	
	@Length(min=0, max=255, message="答案长度不能超过 255 个字符")
	public String getObjAnswer() {
		return objAnswer;
	}

	public void setObjAnswer(String objAnswer) {
		this.objAnswer = objAnswer;
	}
	
}